package com.example.yeujian5.yuejian5.activity;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;

import com.example.yeujian5.yuejian5.R;

public class MainActivity extends AppCompatActivity {

    private Button btn_reg;
    private Button btn_login;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        initViews();
        initEvents();

    }

    public void initViews()
    {
        btn_login=(Button)findViewById(R.id.button1);
        btn_reg=(Button)findViewById(R.id.button2);
    }

    public void initEvents(){

        btn_reg.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent=new Intent(MainActivity.this, RegistActivity.class);
                startActivityForResult(intent,1);
            }
        });

        btn_login.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent=new Intent(MainActivity.this, LoginActivity.class);
                startActivityForResult(intent,1);
            }
        });
    }

}
